﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.Linq;
using System.Data.Linq.Mapping;
using System.Runtime.Serialization;
using System.Xml.Serialization;

namespace EnglishRegister.Entities
{
    [Table(Name = "dbo.Course")]
    public class CourseModel : BaseModel<CourseModel>
    {
        #region **Private**
        private System.Guid _ID;

        private string _Name;

        private System.Nullable<short> _TotalHours;

        private System.Nullable<short> _Level;

        private System.Nullable<int> _LimitPeople;

        private System.Nullable<int> _Tuition;

        private short? _TimeStudy;

        private System.Nullable<System.DateTime> _StartTime;

        private System.Nullable<System.DateTime> _EndTime;

        private string _Description;

        private System.Data.Linq.Binary _TimeStamp;

        //private EntitySet<StudentModel> _Students; 
        #endregion

        #region **Public Properties**
        [global::System.Data.Linq.Mapping.Column(Name = "ID", Storage = "_ID", DbType = "UniqueIdentifier NOT NULL", IsPrimaryKey = true)]
        public System.Guid ID
        {
            get
            {
                return this._ID;
            }
            set
            {
                if ((this._ID != value))
                {
                    this._ID = value;
                }
            }
        }

        [global::System.Data.Linq.Mapping.Column(Name = "Name", Storage = "_Name", DbType = "NVarChar(100)")]
        public string Name
        {
            get
            {
                return this._Name.Trim();
            }
            set
            {
                if ((this._Name != value))
                {
                    this._Name = value.Trim();
                }
            }
        }

        [global::System.Data.Linq.Mapping.Column(Name = "TotalHours", Storage = "_TotalHours", DbType = "SmallInt")]
        public System.Nullable<short> TotalHours
        {
            get
            {
                return this._TotalHours;
            }
            set
            {
                if ((this._TotalHours != value))
                {
                    this._TotalHours = value;
                }
            }
        }

        [global::System.Data.Linq.Mapping.Column(Name = "[Level]", Storage = "_Level", DbType = "SmallInt")]
        public System.Nullable<short> Level
        {
            get
            {
                return this._Level;
            }
            set
            {
                if ((this._Level != value))
                {
                    this._Level = value;
                }
            }
        }

        [global::System.Data.Linq.Mapping.Column(Name = "LimitPeople", Storage = "_LimitPeople", DbType = "Int")]
        public System.Nullable<int> LimitPeople
        {
            get
            {
                return this._LimitPeople;
            }
            set
            {
                if ((this._LimitPeople != value))
                {
                    this._LimitPeople = value;
                }
            }
        }

        [global::System.Data.Linq.Mapping.Column(Name = "Tuition", Storage = "_Tuition", DbType = "Int")]
        public System.Nullable<int> Tuition
        {
            get
            {
                return this._Tuition;
            }
            set
            {
                if ((this._Tuition != value))
                {
                    this._Tuition = value;
                }
            }
        }

        [global::System.Data.Linq.Mapping.Column(Name = "TimeStudy", Storage = "_TimeStudy", DbType = "SmallInt")]
        public System.Nullable<short> TimeStudy
        {
            get
            {
                return this._TimeStudy;
            }
            set
            {
                if ((this._TimeStudy != value))
                {
                    this._TimeStudy = value;
                }
            }
        }

        [global::System.Data.Linq.Mapping.Column(Name = "StartTime", Storage = "_StartTime", DbType = "DateTime")]
        public System.Nullable<System.DateTime> StartTime
        {
            get
            {
                return this._StartTime;
            }
            set
            {
                if ((this._StartTime != value))
                {
                    this._StartTime = value;
                }
            }
        }

        [global::System.Data.Linq.Mapping.Column(Name = "EndTime", Storage = "_EndTime", DbType = "DateTime")]
        public System.Nullable<System.DateTime> EndTime
        {
            get
            {
                return this._EndTime;
            }
            set
            {
                if ((this._EndTime != value))
                {
                    this._EndTime = value;
                }
            }
        }

        [global::System.Data.Linq.Mapping.Column(Name = "Description", Storage = "_Description", DbType = "NVarChar(Max)")]
        public string Description
        {
            get
            {
                return this._Description;
            }
            set
            {
                if ((this._Description != value))
                {
                    this._Description = value;
                }
            }
        }

        [global::System.Data.Linq.Mapping.Column(Name = "TimeStamp", Storage = "_TimeStamp", AutoSync = AutoSync.Always, DbType = "rowversion", IsDbGenerated = true, IsVersion = true, UpdateCheck = UpdateCheck.Never)]
        public System.Data.Linq.Binary TimeStamp
        {
            get
            {
                return this._TimeStamp;
            }
            set
            {
                if ((this._TimeStamp != value))
                {
                    this._TimeStamp = value;
                }
            }
        }
        #endregion
    }
}
